package com.ddxz.tool.web.component;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author 朱宗刚
 * @version 1.0.0
 * @description com.casic.exchange.com.casic.common.tools.component.CasicProperties
 * @date 2020/2/28
 */

@Data
@Component
@ConfigurationProperties(prefix="ddxz")
public class DdxzProperties {
    private Swagger swagger = new Swagger();

    private Fastjson fastjson = new Fastjson();

    private Druid druid = new Druid();

    private License license = new License();

    /**
     * 忽略通过切片记录日志的类, 多个类之间使用逗号分隔 ,org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController
     */
    private String ignoreLogClass = "springfox.documentation.swagger.web.ApiResourceController";

    @Data
    public static class Swagger {
        /**
         * 需要对外提供REST接口的类所在包路径，当前仅支持一个包
         */
        private String path = "";

        /**
         * 该Swagger页面的标题
         */
        private String title = "";

        /**
         * 该Swagger页面的接口的总体描述
         */
        private String desc = "";

        /**
         * 接口的版本号，默认为1.0.0
         */
        private String version = "1.0.0";

        /**
         * 接口开发者的电子邮箱，默认为空
         */
        private String email = "";

        /**
         * 公司名称
         */
        private String company = "丹丹小筑";

        /**
         * 公司网址
         */
        private String address = "https://user.qzone.qq.com/735129162";

        private String host="127.0.0.1";
    }

    @Data
    public static class Fastjson {
        /**
         * fastjson在生成时是否显示null的值，缺省为true
         */
        private Boolean displayNull = true;
    }

    @Data
    public static class Druid {
        /**
         * Druid监控界面的基础URL
         */
        private String path = "/druid/*";
        /**
         * Druid监控界面的管理员名称
         */
        private String userName = "ddxz";
        /**
         * Druid监控界面的管理员登陆密码
         */
        private String password = "Ddxz@123";
        /**
         * Druid 监控界面的白名单, 缺省允许所有IP访问
         */
        private String allow = "";
        /**
         * Druid 监控界面的黑名单，缺省没有禁用的IP地址
         * */
        private String deny = "";
        /**
         * 是否允许重置日志如数
         */
        private Boolean enableReset = false;
    }

    @Data
    public static class License {
        private String file = "";
    }
}
